<?php
namespace org\kahikai\database;

require_once dirname(__FILE__) . '/../domain/User.php';

use org\kahikai\domain\User;

/**
 * 
 * @author ch4mp
 *
 */
interface UserDao {
	
	/**
	 * 
	 * @param string $email the email of seeked user
	 * @return the User with provided email
	 */
	public function getByEmail($email);
	
	/**
	 * 
	 * @param string $id a user id
	 * @return the User with provided id or null
	 */
	public function getById($id);
	
	/**
	 * @param User $user a user to persist
	 * @return newly created user id or null
	 */
	public function saveUser(User $user);
	
	/**
	 * @param User $user a user to update
	 * @return true if user was found and updated
	 */
	public function update(User $user);
}
?>